package com.jemmyee.pizza.service;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.jemmyee.core.dao.Page;
import com.jemmyee.pizza.dao.ITaskDao;
import com.jemmyee.pizza.entity.Task;

@Repository("taskService")
public class TaskServiceImpl implements ITaskService<Task>{

	private static final Log log = LogFactory.getLog(TaskServiceImpl.class);
	
	@Autowired
	private ITaskDao taskDao ;
	
	public void delete(Task entity) {
		taskDao.delete(entity) ;
	}

	public void deleteAll(List<Task> list) {
		taskDao.deleteAll(list);
	}

	public void deleteById(Serializable id) {
		taskDao.deleteById(id);
	}

	public List<Task> findAll() {
		return taskDao.findAll(new Task());
	}

	public List<Task> findByCriteria(DetachedCriteria criteria) {
		return taskDao.findByCriteria(criteria);
	}

	public Task findById(Serializable id) {
		return taskDao.findById(id);
	}

	public List<Task> findByProperty(String propertyName, Object value) {
		return taskDao.findByProperty(new Task(), propertyName, value);
	}

	public Page findPageByCriteria(DetachedCriteria detachedCriteria,
			int pageSize, int startIndex,String order) {
		return taskDao.findPageByCriteria(detachedCriteria, pageSize, startIndex, order);
	}

	public void save(Task entity) {
		taskDao.save(entity) ;
	}

	public void update(Task entity) {
		taskDao.update(entity) ;
	}

}
